import { View, Image, Text } from "@tarojs/components";
import arrowRight from "@/img/comm/arrow-right.png";
import "./index.scss";

interface IUserItemProps {
  sourceData: any;
  handleClick?: () => void;
}

const IUserItem: React.FC<IUserItemProps> = (props) => {
  const { sourceData, handleClick } = props;
  return (
    <View className="user_item flex_row" onClick={handleClick}>
      <View className="img_box">
        <Image src={sourceData.headUrl} className="img" />
      </View>
      <View className="info_box flex_column">
        <View className="info_body">
          <Text className="user_name">{sourceData.userName}</Text>
        </View>
        <Text className="class_info">
          {sourceData?.schoolName ||
            "" + " " + sourceData.gradeName + " " + sourceData.className}
        </Text>
      </View>
      <Image src={arrowRight} className="arrowRight" />
    </View>
  );
};

export default IUserItem;
